-
Notifications
You must be signed in to change notification settings - Fork 42
Add facades for Material $mdToast and $mdDialog services. #72
base: master
Are you sure you want to change the base?
Conversation
First of all, thanks much for the contribution! :) I just checked the official documentation to verify the suggested changes, and it looks mostly good to me. However, I have a few questions and suggestions which I'd like you to consider before I could merge this:
Personally, I'm beginning to change my mind in favor of using immutable options. However, I'm a bit concerned if it would confuse the users if we apply such a convention to this service only, without changing existing codebase as well. So, I hope you could share your opinion about this issue.
And I have a few suggestions as well:
By the way, sorry for the late response, and thanks again for the contribution! |
I am trying to implement your suggestions, but I'm having an issue. I have never used the union types before. If I say:
Then the compiler complains:
The definition of the factory method for
Can you see what I'm doing wrong? |
I'm terribly sorry, but I just realized that I missed your last message somehow. And I was wondering if you have abandoned this PR... Urg. Anyway, to answer you question, I think the On a side note, I guess we can avoid using Again, sorry for my missing your post and I hope to hear from you again. |
No worries. It was my fault since I updated an existing comment rather than posting a new one, so the system deemed it unnecessary to send you an email. I was hoping I would come up with a perfect solution before you noticed, but my hope is unrealized. You are correct about the parameter type for
If you look in my current proposed version of Another issue is the As for overloading, that seems impractical for the But again, the problem with union-types being recognized as |
I finally had some time to investigate this issue. I found that the union operator( As to the
Again, sorry for taking much time to write a reply. I'll try to merge this PR as soon as you could update it this time. Thanks for the patience! |
Okay, so if I want to invoke My first thought is something like this:
But that fails with warnings and errors. Do you know how to determine which of its alternatives ( |
First of all, I'd like to correct my mistake when I said What is returned by that method (and which is also the type of By the way, I'm trying to refactor the relevant API now (c91c8e5), so we might need to wait before the proposed changes to be merged first. With the changes, now we have def apply(controller: ServiceDefinition[_ <: Controller[_]]): MdDialogOptions And you will be able to create a service definition object with I suppose we can probably construct a union type between I'll merge the other PR as soon as I get an approval from the original contributor. |
Just merged the branch which contains the above mentioned enhancement. Please let me know if you need any help integrating the changes. |
My first ScalaJs facade types. Someone who knows more than I should review this.